<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>版本信息</title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bui.css" />
</head>
<body>
<div class="bui-page page-form">
    <header class="bui-bar">
        <div class="bui-bar-left"> <a class="bui-btn btn-back" href="./my.html"><i class="icon-back"></i></a> </div>
        <div class="bui-bar-main">版本信息</div>
        <div class="bui-bar-right"> </div>
    </header>
<main>
    <ul id="listview" class="bui-listview">
    </ul>
</main>
</div>
    <!-- 依赖库 手机调试的js引用顺序如下 -->
    <script src="../js/zepto.js"></script>
    <script src="../js/plugins/fastclick.js"></script>
    <script src="../js/bui.js"></script>
    <script src="../js/common.js"></script>
    <script>
        bui.ready(function () {
            // 这里写业务及控件初始化

            initCommon(bui);

            bui.btn({id: ".bui-page", handle: ".bui-btn"}).load();

            var versionAjax = bui.ajax({
                url: BASE_URL+"/front/versionlist",
                method: "GET"
            });
            versionAjax.then(function(res) {
                if(res.code == 0){
                    var list  = res.data;
                    if(list){
                        $("#listview").html("");
                        for (let i = 0; i < list.length; i++) {
                            var record = list[i];

                            var html = `
                             <li>
                                <div class="bui-btn bui-box-align-top">
                                    <div class="bui-icon primary">
                                        <i class="icon-info"></i>
                                    </div>
                                    <div class="span1">
                                        <h3 class="item-title">版本 `+$$$(record.MC)+`</h3>
                                        <p class="item-text">`+$$$(record.MS)+`</p>
                                    </div>
                                    <span class="time">`+$$$(record.SJ)+`</span>
                                </div>
                            </li>
                            `;
                            $("#listview").append(html);
                        }
                    }
                }else{
                    bui.alert(res.msg);
                }
            },function(res) {
                bui.alert("请求异常");
            })
        })
    </script>
</body>
</html>